$(function(){
	/*banner*/
	$('#indexBanner').flexslider({
		animation: "slide",
		slideDirection: "vertical",
		slideshowSpeed:3000,
		animationLoop:true,
		pauseOnAction:false,
		pauseOnHover: true
	});
	$("img").lazyload({
		placeholder: "",
		effect : "fadeIn"
	});
    loadpopup();
    $(document).on("click",".first-wrap a",function(){
        $(".first-wrap").remove();
        var date=new Date(); 
        var expiresDays = 10000; 
        date.setTime(date.getTime()+expiresDays*24*3600*10000);
        document.cookie="popup=yes; expires="+date.toGMTString();
        loadpopup();
    })

    $(".try-big li .try-big-image").hover(function(){
    	$(this).find("img").animate({"width":"398px","height":"306px","margin":"-154px 0 0 -198px"},300);
    },function(){
    	$(this).find("img").animate({"width":"390px","height":"300px","margin":"-150px 0 0 -195px"},300);
    })
    
})
function get_cookie(Name) 
{ 
   var search = Name + "=" 
   var returnvalue = ""; 
   if (document.cookie.length > 0) { 
     var offset = document.cookie.indexOf(search) 
     if (offset != -1) {    // 如果指定的cookie已经存在                 
        offset += search.length;    // 长度指定到cookie值的位置   
        var end = document.cookie.indexOf(";", offset); 
        
        if (end == -1){
            end = document.cookie.length;  
            returnvalue=unescape(document.cookie.substring(offset, end));
        }else{
            returnvalue=unescape(document.cookie.substring(offset, end)); 
        }                             
      } 
   }   
   return returnvalue; 
} 
function loadpopup(){ 
  if (get_cookie("popup")==""){    
        $(".first-wrap").show();      
    }else{
        $(".first-wrap").remove();
    }
}